package com.woniu.mealsService.service;

import com.woniu.dto.StoreListDTO;
import com.woniu.dto.StoreProductDTO;
import com.woniu.form.ProductForm;
import com.github.pagehelper.PageInfo;
import com.woniu.form.StoreProductListForm;
import com.woniu.mealsService.model.Store;
import com.woniu.mealsService.model.StoreProduct;
import com.baomidou.mybatisplus.extension.service.IService;
import com.woniu.param.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 店铺菜品表 服务类
 * </p>
 *
 * @author jiang
 * @since 2024年12月10日
 */
public interface StoreProductService extends IService<StoreProduct> {

    void updateDiscount(UpdateDiscountParam param, String userId);

    PageInfo<StoreProductDTO> searchStoreProductList(String userId, StoreProductListParam param);

    void putOn(Long productId, String userId);

    void putOff(Long productId, String userId);

    StoreProductDTO searchStoreProductDetail(String productId);

    void addCart(String productId, String userId, Integer num);

    List<Map<String,Object>> searchCarts(String userId);

    Map<String, Object> searchCartByStoreId(String userId, String storeId);

    void clearCart(String userId, String storeId);

    void removeCart(String userId, String productId, Integer num);

    Double getTotalPrice(List<ProductForm> cartList) throws Exception;

    void deleteProduct(Long productId, String userId);

    void addStoreProduct(InsertStoreProductParam param, String userId);

    void updateStoreProduct(UpdateStoreProductParam param, String userId);

    PageInfo<StoreProductDTO> searchAllProductList(AllProductListParam param);

    PageInfo<StoreProductDTO> searchStoreDiscountProductList(String storeId,Integer PageNum,Integer PageSize);

    PageInfo<StoreProductDTO> searchAllDiscountProductList(PageParam param);

    PageInfo<StoreListDTO> searchStoreByProductName(String productName, Integer PageNum, Integer PageSize);
}
